//宽高充满
.w-full {
  width: 100%;
}

.h-full {
  height: 100%;
}

.w-h-full {
  width: 100%;
  height: 100%;
}

//水平、垂直布局
.horizontal {
  display: flex;
  align-items: center;
}

@each $var in 1, 2, 3, 4 {
  .fl-#{$var} {
    flex: $var;
  }
}

@each $name, $justify in ('center', center), ('between', space-between), ('around', space-around), ('end', flex-end){
  .horizontal-#{$name} {
    @extend .horizontal;
    justify-content: $justify;
  }
}

.horizontal-v-start {
  display: flex;
  align-items: flex-start;
}

.horizontal-v-end {
  display: flex;
  align-items: flex-end;
}

.horizontal-v-start > .full {
  flex: 1;
  height: 100%;
  overflow-x: hidden;
}

.horizontal-v-end > .full {
  flex: 1;
  height: 100%;
  overflow-x: hidden;
}

.horizontal-wrap {
  @extend .horizontal;
  flex-wrap: wrap;
}

.horizontal > .right {
  margin-left: auto;
  margin-right: 0;
}
.horizontal > .full {
  flex: 1;
  height: 100%;
  overflow-x: hidden;
}
.vertical {
  display: flex;
  width: 100%;
  flex-direction: column;
}

.vertical-d {
  @extend .vertical;
  width: auto;
}

@each $name, $align in ('center', center), ('end', flex-end){
  .vertical-#{$name} {
    @extend .vertical;
    align-items: $align;
  }
  .vertical-d-#{$name} {
    @extend .vertical-d;
    align-items: $align;
  }
}

.vertical > .full {
  flex: 1;
  overflow-y: hidden;
}

.vertical > .bottom {
  margin-top: auto;
}

//grid 布局
@each $var in 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 {
  .grid-column-#{$var} {
    display: grid;
    grid-template-columns: repeat($var, 1fr);
  }
  .column-#{$var} {
    grid-column: span $var;
  }
  .row-#{$var} {
    grid-row: span $var;
  }
}

.grid-autofit {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 230px));
  justify-content: space-evenly;
  align-content: flex-start;
  padding: 5px;
  & > div {
    margin: 10px 0;
    background: #FFFFFF;
    box-shadow: 0px 2px 17px 0px rgba(0, 0, 0, 0.06);
    border-radius: 12px;
    cursor: default;
  }
}

@each $var in 10,12, 15, 16, 20, 30, 40, 60, 80, 100 {
  .column-gap-#{$var} {
    column-gap: #{$var}px;
  }
}

//内间距、外间距
$number: -10, 0, 2, 3, 4, 5, 6, 8, 10, 12, 13, 14, 15, 16, 17, 18, 19, 20, 24, 30, 40, 50;
$direction: ('top', 't', $number), ('right', 'r', $number), ('bottom', 'b',  $number), ('left', 'l', $number);

@each $var in $number {
  .p-#{$var} {
    padding: #{$var}px;
  }
}

@each $d, $ds, $num in $direction {
  @each $var in $num {
    .p-#{$ds}-#{$var} {
      padding-#{$d}: #{$var}px;
    }
  }
}

@each $var in $number {
  .m-#{$var} {
    margin: #{$var}px;
  }
}

@each $d, $ds, $num in $direction {
  @each $var in $num {
    .m-#{$ds}-#{$var} {
      margin-#{$d}: #{$var}px;
    }
  }
}

$colors: ('primary', #4088FE, #E8F4FF), ('success', #00C484, #DEFCF3), ('disabled', #999999, #F2F3F5),
('warning', #FB9D22, #FFF4E5), ('error', #FF3D40, #FFEEEE), ('off', #888888 , #F2F3F5), ('danger', #FF3D40, #FFEEEE);

@each $name, $color, $colorOpacity in $colors {
  .color-#{$name} {
    color: $color !important;
  }
  .border-#{$name} {
    border-color: $color;
  }
  .bg-#{$name} {
    background: $color;
    &-opacity {
      background: $colorOpacity;
    }
  }
  .el-select.color-#{$name} .el-input__inner {
    color: $color !important;
  }
}

.bg-gray {
  background: #F9F9F9;
}

// 圆角
.border-r-4 {
  border-radius: 4px;
}

/*滚动条*/
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
  &-thumb {
    background-color: rgba(159, 163, 166, 0.3);
    background-clip: padding-box;
    min-height: 28px;
    -webkit-border-radius: 5px;
    -moz-border-radius: 5px;
    border-radius: 5px;
    &:hover {
      background-color: #9FA3A6;
      cursor: pointer;
    }
  }
  &-track  {
    background-color: #EBEDF2;
  }
  &-corner {
    background-color: transparent;
  }
}

//文本省略号
.text-ellipsis {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space:  nowrap;
}
.el-form-item.text-ellipsis .el-input .el-input__inner{
  overflow: hidden;
  text-overflow: ellipsis;
  white-space:  nowrap;
}

//背景色
.bg-white {
  background: #FFFFFF;
}

//筛选栏样式
.horizontal-layout {
  @extend .horizontal-wrap;
  & > label {
    font-size: 14px;
    line-height: 19px;
    font-weight: normal;
    color: #333333;
    margin-right: 10px;
    margin-bottom: 10px;
  }
  & > .el-checkbox {
    margin-bottom: 10px;
  }
  & > div{
    margin-bottom: 10px;
    margin-right: 16px;
    min-height: 28px;
  }
  & > button {
    margin-bottom: 10px;
  }
  & > .right {
    margin-left: auto;
    margin-right: 0;
  }
  &.middle {
    position: relative;
    top: 5px;
  }
}

//下拉过渡动画
.collapse{
  &-enter-active {
    animation: collapse .2s ease;
  }
  &-leave-active {
    animation: collapse .2s ease reverse;
  }
}

@keyframes collapse {
  0% {
    transform: scaleY(0)
  }

  100% {
    transform: scaleY(1)
  }
}

//折叠条件栏
.collapse-content {
  width: 100%;
  position: relative;
  background: #F6F7FA;
  padding-top: 10px;
  padding-left: 10px;
  margin-right: 0 !important;
  margin-top: 5px;
  & > .footer {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: -10px;
    margin-bottom: 10px;
  }
}

//tip样式
.title-tip {
  font-size: 16px;
  line-height: 19px;
  color: #262626;
  display: flex;
  align-items: center;
  font-weight: bold;
  &::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 14px;
    background: #4088FE;
    border-radius: 2px;
    margin-right: 10px;
    border-radius: 3px 3px 3px 3px;
  }
}

.icon-vLine {
  display: inline-block;
  width: 1px;
  height: 14px;
  background: #C9D7EB;
}

//手势样式
@each $cursor in pointer, not-allowed {
  .cursor-#{$cursor} {
    cursor: $cursor !important;
  }
}

//文本不选中样式
.text-not-select {
  -webkit-user-select: none;
  -moz-user-select: none;
  -o-user-select: none;
  user-select: none;
}

//字体粗细样式
@each $var in (100, 200, 300, 400, 500, 600, 700, normal, bold, bolder) {
  .f-w-#{$var} {
    font-weight: $var;
  }
}

//字体大小
@each $var in (12, 14, 16, 18, 20, 22, 24, 26, 28) {
  .f-s-#{$var} {
    font-size: #{$var}px;
  }
}

.font-default {
  font-size: 14px;
  line-height: 19px;
  color: #262626;
}

//当前部门
.option-now {
  font-size: 16px;
  font-weight: bold;
  line-height: 21px;
  display: flex;
  i {
    margin-right: 10px;
  }
}

//部门选择下拉框
.option-select {
  width: 200px;
  .el-input {
    &__inner {
      border: none;
      background: #F2F3F5;
      border-radius: 4px;
      height: 60px;
      font-weight: bold;
      font-size: 16px;
      padding-left: 120px;
      @extend .text-ellipsis;
    }
    &__prefix {
      & > div {
        display: flex;
        align-items: center;
      }
      left: 10px;
      top: 20px;
      line-height: 20px;
      span {
        font-weight: bold;
        font-size: 16px;
        margin-left: 10px;
        color: #333333;
      }
    }
  }
}
//选择排序
.sort-select {
  .el-input > .el-input__inner {
    background: #F2F3F5;
    border-radius: 14px;
    border: none;
  }
  .el-input__suffix .el-icon-arrow-up {
    &::before {
      content: '';
      border-style: solid;
      border-width: 0 5px 5px;
      border-color: transparent transparent #333333;
      position: relative;
      top: -10px;
    }
    &.is-reverse::before {
      transform: rotate(180deg)
    }
  }
}

//定位
.pos-rela {
  position: relative;
}
.pos-abso {
  position: absolute;
}
.pos-flex {
  position: flex;
}

//两输入框间隔线
.rangeLine {
  width: 5px;
  height: 1px;
  background: #000;
  margin: 0 5px 5px -10px;
}

// 全屏 form 底部样式
.screenForm{
  position: relative;
  overflow-y: hidden;
  padding:16px 10px;
  .el-tabs__content{
    position: initial !important;
  }
  .footer{
    position: absolute;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 48px;
    background-color: #fff;
    margin-left: -10px;
    border-top: 1px solid #E3E7EC;
  }
  .boxShadow{
    border-top: none !important;
    box-shadow: 0px -4px 6px rgba(0, 0, 0, 0.15) !important;
  }
}

// 条码状态
$barCodeColors: ('printed', #FF9A26, #FFF4DE), ('send', #9D49F2, #F5ECFE), ('reported', #4088FE, #D7EFFF),
('canceled', #999999, #E4E4E4), ('backed', #FF3D40, #FFEDEE), ('received', #26BF40, #E9F8EC);

@each $name, $color, $colorOpacity in $barCodeColors {
  .el-table__body-wrapper .el-table__body tr > td .cell .barcode-status-#{$name}{
    line-height: 16px;
    padding:4px 12px;
    border-radius: 60px;
    font-size: 12px;
    color: $color;
    background-color: $colorOpacity;
    &::before {
      content: '';
      background-color: $color;
      display: inline-block;
      width: 8px;
      height: 8px;
      border-radius: 50%;
      margin-right: 1px;
    }
  }
  .barcode-status-#{$name} {
    line-height: 16px;
    padding:8px 12px;
    border-radius: 60px;
    font-size: 14px;
    color: $color;
    background-color: $colorOpacity;
    max-width: 100px;
    text-align: center;
    &::before {
      content: '';
      background-color: $color;
      display: inline-block;
      width: 10px;
      height: 10px;
      border-radius: 50%;
      margin-right: 7px;
    }
  }
}
.el-form .check-button.el-checkbox{
  display: flex;
  justify-content: center;
  width: 128px;
  height: 32px;
  line-height: 32px;
  font-size: 14px;
  font-family: MicrosoftYaHei;
  color: #262626;
  border: 1px solid #C7D0DA;
  opacity: 1;
  border-radius: 4px;
}
.el-form .check-button.el-checkbox .el-checkbox__input{
  display: none;
}
.el-form .check-button.el-checkbox.is-checked{
  display: flex;
  justify-content: center;
  width: 128px;
  height: 32px;
  line-height: 32px;
  font-size: 14px;
  font-family: MicrosoftYaHei;
  color: #4088FE;
  background: #EBF3FE;
  border: 1px solid #4088FE;
  opacity: 1;
  border-radius: 4px;
}
.el-form .check-button.el-checkbox.is-checked :after{
  content: '';
  position: absolute;
  right: -0.2px;
  bottom: 0;
  width: 16px;
  height: 16px;
  background: url('../img/ico_img_selected.svg') 100%/100% no-repeat;
}

.el-form .custom-price.el-input-number.is-controls-right .el-input-number__decrease,
.el-form .custom-price.el-input-number.is-controls-right .el-input-number__increase{
  display: none;
}
.el-form .custom-price.el-input-number.is-controls-right .el-input__inner{
  padding-right: 15px !important;
}
.el-form .custom-price.el-input-number .el-input__inner{
  padding-left: 33px;
  text-align: left;
}
.el-form .custom-price.el-input-number::after{
  content: '';
  position: absolute;
  left: 11px;
  top: 25%;
  width: 16px;
  height: 16px;
  background: url('../img/icon_symbol.svg') 100%/100% no-repeat;
}
.el-form .el-input-number.is-controls-right .el-input-number__decrease,
.el-form .el-input-number.is-controls-right .el-input-number__increase{
  line-height: 15px;
}
.gray-bg{
  background-color: #F9F9F9;
}

// 主业务科室切换
.changePopover .departs .depart-item.is-active::after,
.changeLabDepartDialog .departs .depart-item.is-active::after {
  content: '';
  display: block;
  width: 16px;
  height: 16px;
  background: url(../img/ico_img_selected.svg) 100%/100% no-repeat;
  position: absolute;
  right: -1px;
  bottom: -1px;
}

//   /*警告类修改 el-message*/   取消和确认按钮的位置互换
.el-message-box__wrapper .el-message-box .el-message-box__btns {
  display: flex;
  flex-direction: row-reverse;
}

.el-message-box__wrapper .el-message-box .el-message-box__btns button+button {
  margin-right: 10px;
}

.el-message__closeBtn {
  right: 20px
}

//表单(有背景色)
.next-form{
  width: calc(100% + 40px);
  margin-left: -24px;
  padding: 0 24px;
  background-color: #F9F9F9 ;
}

//blood table 统一间距
.bloodTablePadding { // table 与 headBar 容器
  padding: 2px 10px 10px 10px;
}
.bloodTableTopAndBottom { // table
  //padding-bottom: 6px;
  margin-top: -8px;
}
.bloodHeadBarMargin { // 表格上方的headBar 作用于自定义horizontal headBar
  margin-top: 6px;
  margin-bottom: -4px;
}
.bloodHeadBarMargin > .right {
  align-self: baseline;
}
.bloodTopHeadBarSpace{ // 最顶部的headBar
  padding: 4px 10px 0 10px;
  margin-bottom: -6px;
}

.bloodTablePadding .headBar .item-title {
  margin-top: 7px;
}

.font-color-bold {
  color: #262626;
}

.font-color-title {
  color: #666;
}

.font-color-info {
  color: #333;
}

.el-form-item__label {
  color: #666;
}

.el-input-group__append {
  color: #262626;
}

.o-x-auto {
  overflow-x: auto;
}
.o-y-auto {
  overflow-y: auto;
}
.o-x-hidden {
  overflow-x: hidden;
}
.o-y-hidden {
  overflow-y: hidden;
}